package scau.mis4.chanyulin.entity;

import scau.mis4.chanyulin.base.common.Unique;

import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by cyl on 2018/03/27.
 * Employee实体类
 */
public class Employee extends Unique {
    private String name;

    private String gender;

    private String password;

    private String salt;

    private String departmentId;

    private String jobTitle;

    private Integer authLevel;

    // ----------------------------------

    @Transient
    private Department department;

    // ----------------------------------

    public Employee() {
    }

    public Employee(String name, String gender, String password, String salt, String departmentId, String jobTitle, Integer authLevel) {
        this.name = name;
        this.gender = gender;
        this.password = password;
        this.salt = salt;
        this.departmentId = departmentId;
        this.jobTitle = jobTitle;
        this.authLevel = authLevel;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }

    public String getJobTitle() {
        return jobTitle;
    }

    public void setJobTitle(String jobTitle) {
        this.jobTitle = jobTitle;
    }

    public Integer getAuthLevel() {
        return authLevel;
    }

    public void setAuthLevel(Integer authLevel) {
        this.authLevel = authLevel;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    //shiro需要
    public String getCredentialsSalt() {
        return name+salt;
    }
}
